﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="AOP"
    targetNamespace="http://www.mbs.org/AOP.xsd"
    elementFormDefault="qualified"
    xmlns="http://www.mbs.org/AOP.xsd"
    xmlns:mstns="http://www.mbs.org/AOP.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:element name="configuration" nillable="true" type="AOPConfiguration" />
  <xs:complexType name="AOPConfiguration" >
    <xs:sequence>
      <xs:element name="import" type="Import" />
      <xs:element name="mixins" type="MixinCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="interceptors" type="InterceptorCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="aspect" type="Aspect" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Import">
    <xs:attribute name="namespace" type="xs:string" use="required"/>
    <xs:attribute name="assembly" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="MixinCollection">
    <xs:sequence>
      <xs:element name="mixin" type="Mixin"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="InterceptorCollection">
    <xs:sequence>
      <xs:element name="interceptor" type="Mixin"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Mixin" >
    <xs:attribute name="key" type="xs:string" use="required"/>
    <xs:attribute name="type" type="xs:string" use="required"/>
    <xs:attribute name="refTypeEnum" type="TargetType" use="required"/>
  </xs:complexType>
  <xs:simpleType name="TargetType" >
    <xs:restriction base="xs:string">
      <xs:enumeration value="Undefined"/>
      <xs:enumeration value="Link"/>
      <xs:enumeration value="Type"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TypeReference">
    <xs:attribute name="type" type="xs:string" use="required"/>
    <xs:attribute name="refTypeEnum" type="TargetType" use="required"/>
  </xs:complexType>
  <xs:complexType name="Aspect">
    <xs:sequence>
      <xs:element name="for"  type="For" minOccurs="1" maxOccurs="1"/>
      <xs:element name="mixin" type="TypeReference"  minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="pointcut" type="Pointcut" minOccurs="0"  maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="Pointcut">
    <xs:sequence>
      <xs:element name="signature" minOccurs="0" maxOccurs="1"/>
      <xs:element name="interceptor" type="TypeReference" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="symbol" type="PointCutFlags" use="required"/>
  </xs:complexType>
  <xs:complexType name="For">
    <xs:sequence>
      <xs:element name="singletype" type="TypeReference" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="PointCutFlags" >
    <xs:restriction base="xs:string">
      <xs:enumeration value="Unspecified"/>
      <xs:enumeration value="Method"/>
      <xs:enumeration value="Property"/>
      <xs:enumeration value="PropertyRead"/>
      <xs:enumeration value="PropertyWrite"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
